// ignore_for_file: camel_case_types

import 'dart:io';

import 'package:get/get.dart';
import 'package:yt_devops/resources/str_res_keys.dart';

class AboutUsState {
  AboutUsState();

  List<MessageTimeModel> aboutUsLabelList = [
    MessageTimeModel(title: ""),
    MessageTimeModel(title: ResKey.help.tr),
    // MessageTimeModel(title: ResKey.giveMeARating.tr),
    MessageTimeModel(title: ResKey.privatePolicy.tr),
    MessageTimeModel(title: ResKey.update.tr),
  ];
}

class MessageTimeModel {
  MessageTimeModel({
    this.title,
  });

  String? title;
}

class AboutInfoState {
  /// APP名称
  String? appName;

  /// 包名
  String? packageName;

  /// 版本号
  String? version;

  /// 构建号
  String? buildNumber;

  /// 应用市场上的 App ID
  String? get appId {
    if (Platform.isAndroid) {
      if (packageName?.endsWith(".dev") ?? false) {
        return packageName?.replaceFirst(".dev", "");
      } else if (packageName?.endsWith(".stage") ?? false) {
        return packageName?.replaceFirst(".stage", "");
      } else {
        return packageName;
      }
    } else if (Platform.isIOS) {
      return "6473716201";
    }
    return null;
  }

  AboutInfoState({
    this.appName,
    this.packageName,
    this.version,
    this.buildNumber,
  });
}
